/**
 * 注册用户数据库模型
 */

const mongoose = require("mongoose");

const Schema = mongoose.Schema;

const commentSchema = new Schema(
  {
    user_id: {
      type: Number,
      required: [true, "用户id不允许为空"],
    },
    md_id: {
      type: Number,
      required: [true, "文章id不允许为空"],
    },
    content: {
      type: String,
      required: [true, "评论内容不允许为空"],
    },
  },
  {
    timestamps: { createdAt: "createTime", updatedAt: "updateTime" },
  }
);

const commentModel = mongoose.model("Comment", commentSchema);

module.exports = commentModel;
